package cn.zijitc.domain;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

public class main {
    public static void main(String[] args) throws IOException {
        Person person=new Person("张三",12);
        ObjectMapper mapper=new ObjectMapper();
        String json=mapper.writeValueAsString(person);
        System.out.println(json);
        Person person1=new Person();
        person1=mapper.readValue(json,Person.class);
        System.out.println(person1);
    }
}
